﻿using System;
using System.Collections.Generic;

namespace CompactMapper.Orm.Annotations
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
    public class IndexAttribute : PersistenceAttribute
    {
        private readonly string _indexName;
        private readonly IEnumerable<String> _includeProperties;

        public IEnumerable<string> IncludeProperties
        {
            get { return _includeProperties; }
        }

        public string IndexName { get { return _indexName; } }

        public IndexAttribute(String indexName, params String[] includeProperties)
            : this(indexName)
        {
            _includeProperties = includeProperties;
        }

        public IndexAttribute(String indexName)
        {
            _indexName = indexName;
        }

        public IndexAttribute()
            : this(String.Empty)
        {
        }
    }
}
